public class MyTime {
    private int year;
    private int month;
    private int day;
    private int hour;
    private int minute;
    private int second;

    // 构造函数
    public MyTime (int year, int month, int day, int hour, int minute, int second) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }

    // 获取年
    public int getYear() {
        return year;
    }

    // 设置年
    public void setYear(int year) {
        this.year = year;
    }

    // 获取月
    public int getMonth() {
        return month;
    }

    // 设置月
    public void setMonth(int month) {
        this.month = month;
    }

    // 获取日
    public int getDay() {
        return day;
    }

    // 设置日
    public void setDay(int day) {
        this.day = day;
    }

    // 获取时
    public int getHour() {
        return hour;
    }

    // 设置时
    public void setHour(int hour) {
        this.hour = hour;
    }

    // 获取分
    public int getMinute() {
        return minute;
    }

    // 设置分
    public void setMinute(int minute) {
        this.minute = minute;
    }

    // 获取秒
    public int getSecond() {
        return second;
    }

    // 设置秒
    public void setSecond(int second) {
        this.second = second;
    }

    // 格式化时间输出
    public String toString() {
        return String.format("%04d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, second);
    }

}
